package procilege.impl.formatter;

import procilege.compute.ExprFormatTraveller;
import procilege.compute.PlaceTypeMetadata;
import procilege.compute.PlaceType;
import procilege.lang.ExprSubstitute;

@PlaceTypeMetadata(type = ExprSubstitute.class)
public class ExprSubstituteFormatter implements PlaceType<ExprFormatTraveller> {

	public void visit(ExprFormatTraveller tr, Object place) {

		ExprSubstitute n = (ExprSubstitute) place;

		StringBuilder sb = tr.getBuilder();
		sb.append('(');
		tr.setout(n.getExpr());
		sb.append(')');
		sb.append('{');
		tr.setout(n.getObject());
		sb.append('/');
		tr.setout(n.getBoundedName());
		sb.append('}');
	}
}